package com.fishbone.sso.service.impl;

import com.fishbone.sso.service.RoleService;
import lombok.AllArgsConstructor;
import org.springframework.web.client.RestTemplate;

import java.util.HashSet;
import java.util.Set;

@AllArgsConstructor
public class DefaultRoleService implements RoleService {

    private final RestTemplate restTemplate;

    @Override
    public Set<String> queryRoleByPattern(String pattern) {
        Set<String> roles = new HashSet<>();
        roles.add("ROLE_ADMIN");
        roles.add("ROLE_USER");
        return roles;
    }

    @Override
    public Set<String> queryAllAvailable() {
        Set<String> roles = new HashSet<>();

        roles.add("ROLE_ADMIN");
        roles.add("ROLE_APP");
        roles.add("ROLE_LEADER");
        roles.add("ROLE_ROOT");

        return roles;
    }
}
